RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    1. Home
    2. Tags
    3. shutdown script
    Log in to post
    • All categories
    • SixSpeedDeathS

      Modify a safe shutdown script.

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support shutdown script shutdown menu
      20
      0 Votes
      20 Posts
      6k Views
      cyperghostC

      @drakaen391 About your posted codings.... Does the wait command works in your case? @mediamogul and his while-loop by monitoring PID status is imho better ...

      wait can only be used on child processes out of the own subshell

    • NachosN

      Graceful GPIO reboot/shutdown (saves srm and metadata) Python functions

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support emulationstaion metadata issues shutdown script retroarch gpio
      6
      3 Votes
      6 Posts
      1k Views
      mituM

      @psb The poster hasn't been on this forum for 1 year and bumping old topics is bad forum etiquette. If you have a question, then open a new topic and ask away - don't re-open years old topics.

    • SmellyVikingS

      (BUILT+PICS!)Before i buy, will these parts all work together?

      Watching Ignoring Scheduled Pinned Locked Moved Projects and Themes retro pie shutdown script raspberry pi 3b nespi case usb drive
      6
      0 Votes
      6 Posts
      2k Views
      SmellyVikingS

      OK bought everything and built it and it works great. 2tb harddrive would not fit but the 1 tb one does : )
      whats words without pics. so here ya go.
      0_1523061807508_image9.jpg

      0_1523061725394_image10.jpg

      0_1523062119332_image5.jpg

      0_1523062151644_image3.jpg

      0_1523062182808_image4.jpg

      0_1523062209688_image6.jpg

      0_1523062237514_image8.jpg

      deleted case ethernet port,case door hinges came out for room, glued closed. had to put dedicated power to the hd to spin right so extra usb port grafted to the drives power wires while data wires go to pie. runs cool enough 50 degrees-ish so far. case closes tighter than pics when screwed together. just took some quick snaps to share. think it turned out pretty good.

    • S

      METADATA not saving - Favorites will never remain tagged

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support nespi case metadata issues favorites shutdown script gameslist.xml
      121
      0 Votes
      121 Posts
      20k Views
      S

      @cyperghost ok I figured it out :)
      it's a little bit of a bug but totally fixable.

      ES uses both gamelist.xml found at /opt/retropie/configs/all/emulationstation/gamelists/"console"/ and /home/pi/RetroPie/roms/"console"/

      so if there's no gamelist.xml in the console folder under roms, it will use the one found in configs. for some reason it doesn't remove entries, only adds them.

      it will also not untag favorites if you DO have a gamelist.xml in your roms but DON'T have an entry in your gamelist.xml for the tagged favorite game.

      Best word of advice: scrape like you've never scraped before lol

    • M

      Shutdown Button

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support shutdown script
      6
      0 Votes
      6 Posts
      1k Views
      cyperghostC

      @matalog I'm not very firm in python.
      But take a look to this link
      https://raw.githubusercontent.com/LowPowerLab/ATX-Raspi/master/shutdownchecksetup.sh

      and to this link
      https://lowpowerlab.com/guide/atxraspi/assembly-install/

      shows how to use a timer to differ button event between shutdown and reboot in accordance of button press time. I think that is your demand....

    • THRobinsonT

      RetroPie withe NesPi Case - Shutdown

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support nespi nespi case shutdown shutdown script shutdown switch
      1
      0 Votes
      1 Posts
      1k Views
      No one has replied
    • fredcobainF

      Issues on Restart ES/Shutdown/Restart System - Quit Menu

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support shutdown script restart issue quit menu
      2
      0 Votes
      2 Posts
      866 Views
      fredcobainF

      Solution:

      Copied emulationstation from /usr/bin to /usr/local/bin and things worked as normal.

    • cyperghostC

      ensuring ES gracefully finish ... annother approach

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support shutdown script emulationstatio favorites last played metadata issues
      8
      0 Votes
      8 Posts
      2k Views
      cyperghostC

      @meleu said in ensuring ES gracefully finish ... annother approach:

      @caver01 it wouldn't work for any shutdown. And I'm afraid it wouldn't work in any case. And you guessed the reason: "those files created by ES too short-lived".

      edit: as you can see in emulation.sh script, those files are removed right before calling reboot|poweroff, then killes.sh won't be able to see them.

      Correct - the files are not living to long to check via testcommand fileexistance!
      Therefore the incron job triggers existance of files and gives feedback to script!
      This works in any cases!

      I did long testing with this and all files ... even if they were created and removed like

      touch /tmp/testfile.dat && rm /tmp/testfile.dat

      The script was always triggered. So YES this solution is working as else. But I was in need to use two more files... that give "feedback" what was triggered now?

      Is it a shutdown via software? >> action_software-file is created and checked
      Is it a shutdown via hardware? >> action_hardware-file is created and checked

      So how does a software shutdown + GPIO triggering works?

      Quit Menu -- ES Shutdown ES creates file /tmp/es-shutdown incron triggers script and realizes "action_software" /tmp/es-shutdown is removed by ES shutdown script .... incron trigger is still active incronscript triggers GPIO and set transistor to high Now... the button shutdown script from Mausberry, bash, python... as you like is triggered (as a button press is recognizes) This button shutdown script calls again the incron script /home/pi/incrontrol.sh button-shutdown in the incrontrol.sh is a check for file ... "action_software" for usecase button-shutdown > Exit in background the ES shutdown is still performed GPIO is triggered, mausberry is off, regular shutdown performed

      @meleu said in ensuring ES gracefully finish ... annother approach:

      @caver01 the simplest solution I can think is to use a systemd trick again. Let's discuss on your thread to not mess this one.

      As I said in OP ... the systemd trick is a general solution and seems easier to maintain.
      But there are always many roads that leads to rome: Let us collect experience

    • meleuM

      ensuring ES gracefully finish and save metadata in every system shutdown

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support shutdown script emulationstatio favorites last played metadata issues
      96
      15 Votes
      96 Posts
      43k Views
      cyperghostC

      @tictac_93 This works in most cases ... yes

      But look. You take PID of runcommand and use pkill -P switch to kill child PID. That works in most cases but some emulators also just call annother process and this won't be catched by your method. You need at least annother pkill -P call.

      You should just use your python script and you can use the multi_switch and it's command line options. Therefore use a python call like output = int(subprocess.check_output(['./multi_switch.sh', '--es-pid'])) and you can check if ES is running. If the ouput is 0 then python interprets this as false if a PID is detected the value is grater than 0 - this interprets python as true.
      So the sniplet in python itself would be look like this.

      if output: os.system("./multi_switch.sh --es-poweroff") else: os.system("sudo shutdown -h now")
    • caver01C

      Replacing Mausberry Script with a Python script

      Watching Ignoring Scheduled Pinned Locked Moved Ideas and Development shutdown script shutdown switch mausberry
      33
      2 Votes
      33 Posts
      9k Views
      lostlessL

      @diy_glenn said in Replacing Mausberry Script with a Python script:

      But I've connected the Reset button on my NESPi to GPIO instead, so it can be used for something more useful. F.ex. one click = reset ROM, double click = reboot etc.

      sorry all for the slight derailment, but this forum has no private message system. @DIY_glenn, im looking to do something similar with my reset button on my nespi but lost on how to hook up the gpio and how to wright a script. Many you can make a thread to explain how you did it and help us others out. I really want to learn this stuff.

    • C

      Favorites will only save if shutdown by menu option and not via GPIO Shutdown Script

      Watching Ignoring Scheduled Pinned Locked Moved Help and Support favourites shutdown script
      9
      0 Votes
      9 Posts
      3k Views
      C

      @meleu said in Favorites will only save if shutdown by menu option and not via GPIO Shutdown Script:

      Hello guys! I would like to suggest the solution I proposed here:
      https://retropie.org.uk/forum/topic/12895/ensuring-es-gracefully-finish-and-save-metadata-in-every-system-shutdown

      Let me know if you guys find some problem.

      Cheers!

      Thanks for this - I'll give it a 'bash' later :-)